<%-- 
    Document   : search_result
    Created on : Mar 31, 2012, 11:22:18 PM
    Author     : Ajay Kumar "Mukund"
--%>

<%@page import="java.sql.*"%>
<%@page import="jobportal.Dbconn" %>
<%
    Connection con2 = Dbconn.getConn();
    Statement st2 = con2.createStatement();
    ResultSet rs2;
    String src = "";
    String apply="student.jsp";
    if (session.getAttribute("username") != null) {
        src = "../";
        apply="applyjob";
    }
%>

<table border="0" width="100%" cellspacing="0" cellpadding="0" style=" height:auto;">
    <td ><tbody>
        <tr>
            <td  align="left" valign="top" style="padding-left:5px; padding-top:10px; padding-right:5px;">	</script>
                <span class="mainheading">Basic Search Result</span><br />
                <%
                    String keys = "", location = "";
                    if (request.getParameter("title") != null && !request.getParameter("title").equals("Enter Job Keyword")) {
                        keys = request.getParameter("title");
                    }
                    if (request.getParameter("location") != null && !request.getParameter("location").equals("Enter Job City")) {
                        location = request.getParameter("location");
                    }
                %>
                <table border="0" width="100%" align="center" cellpadding="0" cellspacing="0">
                    <tbody><tr>
                            <td style="padding-left:2px; padding-top:10px; padding-right:5px; padding-bottom:10px;text-align: left">
                                <span>You Searched For</span> :
                                <%=keys%>: <%=location%> | </td>
                        </tr>

              </tbody></table>
                <div class="heading_line_hor"><!-- --></div>

                
                    <table border="0" align="center" cellpadding="0" width="100%" cellspacing="0">
                        <tbody>
                            <%try {
String sqlapp="";
                                if(session.getAttribute("username")!=null)
                                        sqlapp=" and validuntil>curdate()";
                                    String sql2 = "select jobid,jobtitle,minexp,maxexp,funarea,salary,salarytype,jobpostdate,jobdesc,jobrole,joblocation,keyskill,company.compid,compname,metakeys  from jobs,company where jobs.compid=company.compid and jobs.status='Active' and metakeys like '%" + keys + "%' and joblocation like '%" + location + "%'  "+sqlapp;

                                    rs2 = st2.executeQuery(sql2);
                                    while (rs2.next()) {
                            %>
                      <form name="frm1" id="frm1" method="post" action="<%=apply%>" >
                            <tr>
                                <td align="center" valign="top"><table width="100%" height="156" border="0" align="center" cellpadding="0" cellspacing="0">
                                        <tbody>
                                            <tr>
                                                <td height="154" align="left" valign="top">
                                                    <table border="0" width="100%" cellpadding="0" cellspacing="0" class="tblBorder">
                                                        <tbody>
                                                            <tr>
                                                              <td></td>
                                                              <td height="25" align="left" valign="middle">&nbsp;</td>
                                                              <td align="left" valign="middle">&nbsp;</td>
                                                              <td align="left" valign="middle">&nbsp;</td>
                                                            </tr>
                                                            <tr>
                                                              <td width="4%"></td>
                                                              <td width="21%" height="25" align="left" valign="middle">
                                                                  <img src="<%=src%>src/getpic.jsp?id=<%=rs2.getString("company.compid")%>&amp;table=company&amp;col=logo&amp;pk_col=compid" alt="compimage" width="125" height="35" border="0" />
                                                              </td>
                                                              <td width="56%" align="left" valign="middle">
                                                                  <span style="text-transform:capitalize;font-size:+1">
                                                                      <a class="link" href="viewjobdetails.jsp?jobid=<%=rs2.getString("jobid")%>" >
                                                                          <strong>
                                                                              <%=rs2.getString("jobtitle")%> 
                                                                          </strong> 
                                                                      </a> </span> (<%=rs2.getString("minexp")%> -<%=rs2.getString("maxexp")%> Yrs.)
                                                                <input type="hidden" name="jobid" value="<%=rs2.getString("jobid")%>" />
                                                                <input type="hidden" name="msg" value="&lt;font color=red&gt;Login First to apply this job&lt;/font&gt;"/></td>
                                                              <td width="19%" align="left" valign="middle"><input name="apply" type="submit" id="apply" value="Apply This Job" class="button3" /></td>
                                                            </tr>
                                                            <tr>
                                                                <td></td>
                                                              <td height="25" colspan="3" align="left" valign="middle"><span style="padding-top:4px;"><strong><%=rs2.getString("compname")%></strong><span style="padding-bottom:10Px;"> ( <%=rs2.getString("joblocation")%> )</span></span></td>
                                                            </tr>

                                                            <tr>
                                                                <td></td>
                                                                <td colspan="3" align="left" valign="top" style="padding-bottom:2px; padding-right:5px;">
                                                                    <%=rs2.getString("jobdesc")%></td>
                                                            </tr>
                                                            <tr>
                                                                <td></td>
                                                                <td colspan="3" align="left" valign="top" style="padding-bottom:2px;">Key Skills :-<%=rs2.getString("keyskill")%></td>
                                                            </tr>
                                                            <tr>
                                                                <td>&nbsp;</td>
                                                                <td colspan="3" align="left" valign="top" style="padding-bottom:2px;">Function Area :- <%=rs2.getString("funarea")%></td>
                                                            </tr>
                                                            <tr>
                                                                <td>&nbsp;</td>
                                                                <td colspan="3" align="left" valign="top" style="padding-bottom:2px;">Salary :-
                                                                    <%=rs2.getString("salary")%>&nbsp;INR&nbsp;<%=rs2.getString("salarytype")%>             | <span style="padding-right:5px;">Posted On :-<%=rs2.getString("jobpostdate")%>&nbsp;</span> </td>
                                                            </tr>
                                                            <tr>
                                                                <td>&nbsp;</td>
                                                                <td colspan="3" align="left" valign="top" style="padding-bottom:2px;"><a class="link" href="student.jsp">Apply this Job</a></td>
                                                            </tr>

                                                            <tr>
                                                                <td></td>
                                                                <td colspan="3" align="left" valign="top"><div class="spacer_line1"><!-- --></div></td>
                                                            </tr>
                                                        </tbody>
                                                  </table>
                                                    <img src="./searchResult_files/blank.gif" alt="blank" width="18" height="5" border="0"><br />


                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                      </form>
                            <% }
                                 } catch (Exception e) {
                                     out.println(e);
                                 }%>
                            <tr>
                                <td>
                                    <img src="./searchResult_files/blank.gif" width="1" height="5" border="0"><br /></td></tr>
                        </tbody>
              </table>
                
                <div class="rf">
                </div><br />
                <div class="dotimageborderx" style="padding-top:2px; padding-bottom:2px;"><img src="./searchResult_files/blank.gif" width="1" height="5" border="0"><br /></div>
          </td>

            <%
                if (session.getAttribute("username") == null) {
            %>
            <td align="left" valign="top">
                <div style=" position:relative;width:300px; height:auto; margin:10px 10px 0px 0px;" class="div_bdr">

                    <div style="clear:both;"></div>		<div style="clear:both; height:8px;"></div>


                    <style type="text/css">
                        #marqueecontainer{
                            position: relative;
                            float:left;
                            width: 150px; /*marquee width */
                            height: 150px; /*marquee height */
                            background-color: white;
                            overflow: hidden;
                            border: 0px solid orange;
                            padding: 0px;
                            padding-left: 0px;
                        }
                    </style>

                    <script type="text/javascript">
                        var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
                        var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
                        var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

                        ////NO NEED TO EDIT BELOW THIS LINE////////////

                        var copyspeed=marqueespeed
                        var pausespeed=(pauseit==0)? copyspeed: 0
                        var actualheight=''

                        function scrollmarquee(){
                            if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
                                cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
                            else
                                cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
                        }

                        function initializemarquee(){
                            cross_marquee=document.getElementById("vmarquee")
                            cross_marquee.style.top=0
                            marqueeheight=document.getElementById("marqueecontainer").offsetHeight
                            actualheight=cross_marquee.offsetHeight
                            if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
                                cross_marquee.style.height=marqueeheight+"px"
                                cross_marquee.style.overflow="scroll"
                                return
                            }
                            setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
                        }

                        if (window.addEventListener)
                            window.addEventListener("load", initializemarquee, false)
                        else if (window.attachEvent)
                            window.attachEvent("onload", initializemarquee)
                        else if (document.getElementById)
                            window.onload=initializemarquee
                    </script>



                    <div style="width:300px; height:206px; margin:5px 10px 0px 0px; " class="div_bdr">
                        <%@include file="latestjob.jsp"%>
                    </div>

                    <div style="clear:both; height:8px;"></div>

          </td>
            <%}%>
        </tr>



        
    </tbody>
</table>

